<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="static/js/vue.js"></script>
    <script type="text/javascript" src="static/js/index.js"></script>
    <link rel="stylesheet" href="static/css/index.css">
    <script th:src="@{static/js/axios.min.js}"></script>
    <title>Document</title>
</head>


<style>
    .el-table .warning-row {
        background: rgb(126, 238, 35);
    }

    .el-table .success-row {
        background: #f0f9eb;
    }

    /*
    包裹表格div的距離外邊距的距離
    width:85% 為寬度
    margin：為左边距
    margin-top為右边距
    */

    #app {
        width: 100%;

    }
</style>

<body>


<div id="app">
    <el-row class="demo-autocomplete">
        <el-col :span="2">车型名称</el-col>
        <el-col :span="6">
            <el-autocomplete
                    class="inline-input"
                    v-model="findV.brands"
                    size="small"
                    :fetch-suggestions="querySearch"
                    placeholder="请输入车型名称"
                    @select="handleSelect"
            ></el-autocomplete>
        </el-col>

        <el-col :span="2">车身颜色</el-col>
        <el-col :span="6">

            <el-autocomplete
                    class="inline-input"
                    v-model="findV.carColor"
                    size="small"
                    :fetch-suggestions="querySearch"
                    placeholder="请输入车身颜色"
                    :trigger-on-focus="true"
                    @select="handleSelect"
            ></el-autocomplete>
        </el-col>
    </el-row>
    <br>
    <el-row>
        <el-col :span="2">  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;客户姓名:</el-col>
        <el-col :span="6">

            <el-autocomplete
                    class="inline-input"
                    v-model="findV.name"
                    size="small"
                    :fetch-suggestions="querySearch"
                    placeholder="请输入客户姓名"
                    :trigger-on-focus="false"
                    @select="handleSelect"
            ></el-autocomplete>
        </el-col>
        <el-col :span="2"> &nbsp;&nbsp;&nbsp;手机号:</el-col>
        <el-col :span="6">

            <el-autocomplete
                    class="inline-input"
                    v-model="findV.telephone"
                    size="small"
                    :fetch-suggestions="querySearch"
                    placeholder="请输入客户电话号码"
                    :trigger-on-focus="false"
                    @select="handleSelect"
            ></el-autocomplete>
        </el-col>
        <el-col :span="6">
            <el-button type="primary" icon="el-icon-search" size="small" @click="findByParam(1,10)">查询</el-button>

            <el-button type="primary" size="small" @click="dialogFormVisibleadd = true"  icon="el-icon-circle-plus-outline">添加</el-button>
            <el-button size="small" @click="exportfile(1,10)"  type="primary" plain   icon="el-icon-download">导出<i class="el-icon-upload el-icon--right"></i></el-button>
        </el-col>
    </el-row>

    <!--table 模板  ：data 绑定了数据 tableData-->
    <template style="width: 100%">
        <el-table
                :data="tableData"
                style="width: 100%;height: 700px;"
                :row-class-name="tableRowClassName"
                :header-cell-style="{'text-align':'center'}"
                :cell-style="{'text-align':'center'}">
            <el-table-column
                    prop="id"
                    label="车辆编号"
                    width="150">
            </el-table-column>
            <el-table-column
                    prop="brands"
                    label="车型名称"
                    width="120">
            </el-table-column>
            <el-table-column
                    prop="vehicleLicense"
                    label="车辆牌号"
                    width="150">
            </el-table-column>
           <el-table-column
                    prop="customerInfo.productInfo.moneyChannelInfo.ditchAllname"
                    label="来源渠道"
                    width="150">
            </el-table-column>
            <!--<el-table-column
                    prop="orderStatus"
                    label="处置状态"
                    width="80">
            </el-table-column>-->
            <el-table-column
                    prop="carColor"
                    label="车身颜色"
                    width="120">
            </el-table-column>


            <el-table-column
                    prop="customerInfo.name"
                    label="客户姓名"
                    width="150">
            </el-table-column>
            <el-table-column
                    prop="customerInfo.telephone"
                    label="客户手机号 "
                    width="150">
            </el-table-column>
           <el-table-column
                    prop="customerInfo.productInfo.moneyChannelInfo.createTime"
                    :formatter="dateFormatter"
                    label="创建时间 "
                    width="200">
            </el-table-column>
            <el-table-column
                    label="操作"
                    width="230">
                <template slot-scope="scope">
                    <!--handleClick 为点击查看点击事件,括号内的scope.row为当前行的所有参数,要拿什么参数,直接 scope.row参数名-->
                    <el-button type="text" size="small" @click="dialogFormVisiblefind = true ,find_vehicleInfo(scope.row)">查看</el-button>
                    <el-button type="text" size="small" @click="dialogFormVisiblemod = true,fill_vehicleInfo(scope.row)">更新</el-button>
                </template>
            </el-table-column>
        </el-table>
        <!--Element分頁插件 有待改进-->
        <el-pagination
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                layout="total,prev, pager, next, jumper"
                :total="total">
        </el-pagination>
    </template>

    <!--新增车辆模态框-->
    <el-dialog title="新增车辆" :visible.sync="dialogFormVisibleadd" fullscreen>
        <el-form ref="AformInfo" :model="AformInfo" label-width="80px">
            <el-row>
                <el-form-item  label="车辆信息">
                </el-form-item>
            </el-row>
            <el-row>
                <el-col :span="12" style="width: 35%">
                    <el-form-item label="车辆品牌">
                        <el-input v-model="AformInfo.brands"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="12" style="width: 35%;margin-left: 10%">
                    <el-form-item label="车型">
                        <el-input v-model="AformInfo.carModel"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12" style="width: 35%">
                    <el-form-item label="车牌号">
                        <el-input v-model="AformInfo.vehicleLicense"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="12" style="width: 35%;margin-left: 10%">
                    <el-form-item label="车架号">
                        <el-input v-model="AformInfo.frameNumber"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12" style="width: 35%">
                    <el-form-item label="发动机号">
                        <el-input v-model="AformInfo.engineNumber"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="12" style="width: 35%;margin-left: 10%">
                    <el-form-item label="车身颜色">
                        <el-input v-model="AformInfo.carColor"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12" style="width: 35%">
                    <el-form-item label="车辆年限">
                        <el-input v-model="AformInfo.vehicleYears"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="12" style="width: 35%;margin-left: 10%">
                    <el-form-item label="购车时间">
                        <el-date-picker
                                v-model="AformInfo.buyTime"

                                value-format="yyyy-MM-dd"
                                type="date"
                                placeholder="选择日期">
                        </el-date-picker>
                    </el-form-item>

                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12" style="width: 35%">
                    <el-form-item label="裸车价格">
                        <el-input v-model="AformInfo.bareCarPrice"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="12" style="width: 35%;margin-left: 10%">
                    <el-form-item label="上牌时间">
                        <el-date-picker
                                v-model="AformInfo.carLicenseTime"
                                value-format="yyyy-MM-dd"
                                type="date"
                                placeholder="选择日期">
                        </el-date-picker>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12" style="width: 35%">
                    <el-form-item label="行驶里程">
                        <el-input v-model="AformInfo.drivenDistance"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="12" style="width: 35%;margin-left: 10%">
                    <el-form-item label="车况" :label-width="formLabelWidth">
                        <el-select v-model="AformInfo.carCondition" placeholder="请选择车况">
                            <el-option label="99新" value="99新"></el-option>
                            <el-option label="95新" value="95新"></el-option>
                            <el-option label="8成新" value="80新"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12" style="width: 35%">

                </el-col>
            </el-row>


            <el-row>
                <el-form-item  label="车辆图片" v-model="AformInfo.carAppearance">
                </el-form-item>
            </el-row>
            <el-upload
                    action="vehicle/importImg"
                    list-type="picture-card"
                    :on-success="handleSuccessOne"
                    :on-remove="handleRemove">
                <i class="el-icon-plus"></i>
            </el-upload>
            <el-dialog :visible.sync="dialogVisible">
                <img width="100%" :src="dialogImageUrl" alt="">
            </el-dialog>

            <el-row>
                <el-form-item  label="内饰" v-model="AformInfo.carInterior">
                </el-form-item>
            </el-row>
            <el-upload
                    action="vehicle/importImg"
                    list-type="picture-card"
                    :on-success="handleSuccessTwo"
                    :on-remove="handleRemove">
                <i class="el-icon-plus"></i>
            </el-upload>
            <el-dialog :visible.sync="dialogVisible">
                <img width="100%" :src="dialogImageUrl" alt="">
            </el-dialog>

            <el-row>
                <el-form-item  label="发动机" v-model="AformInfo.carEngine">
                </el-form-item>
            </el-row>
            <el-upload
                    action="vehicle/importImg"
                    list-type="picture-card"
                    :on-success="handleSuccessThree"
                    :on-remove="handleRemove">
                <i class="el-icon-plus"></i>
            </el-upload>
            <el-dialog :visible.sync="dialogVisible">
                <img width="100%" :src="dialogImageUrl" alt="">
            </el-dialog>

            <el-row>
                <el-form-item  label="底盘" v-model="AformInfo.carChassis">
                </el-form-item>
            </el-row>
            <el-upload
                    action="vehicle/importImg"
                    list-type="picture-card"
                    :on-success="handleSuccessFour"
                    :on-remove="handleRemove">
                <i class="el-icon-plus"></i>
            </el-upload>
            <el-dialog :visible.sync="dialogVisible">
                <img width="100%" :src="dialogImageUrl" alt="">
            </el-dialog>

            <el-row>
                <el-form-item  label="其他" v-model="AformInfo.carOther">
                </el-form-item>
            </el-row>
            <el-upload
                    action="vehicle/importImg"
                    list-type="picture-card"
                    :on-success="handleSuccessFive"
                    :on-remove="handleRemove">
                <i class="el-icon-plus"></i>
            </el-upload>
            <el-dialog :visible.sync="dialogVisible">
                <img width="100%" :src="dialogImageUrl" alt="">
            </el-dialog>
        </el-form>

        <div slot="footer" class="dialog-footer">
            <el-button @click="dialogFormVisibleadd = false">取 消</el-button>
            <el-button type="primary" @click="dialogFormVisibleadd = false,add()">确 定</el-button>
        </div>
    </el-dialog>




    <!--查看模态框-->
    <el-dialog title="车辆资产详情" :visible.sync="dialogFormVisiblefind" fullscreen>
        <el-form ref="formInfo" :model="formInfo" label-width="80px">
            <el-row>
                <el-form-item  label="客户信息">
                </el-form-item>
            </el-row>
            <el-row>
                <el-col :span="12" style="width: 35%">
                    <el-form-item  label="订单编号">
                        <el-input v-model="formInfo.num"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12" style="width: 35%;margin-left: 10%">
                    <el-form-item label="借款状态">
                        <el-input v-model="formInfo.status"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12" style="width: 35%">
                    <el-form-item label="客户姓名">
                        <el-input v-model="formInfo.name"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="12" style="width: 35%;margin-left: 10%">
                    <el-form-item label="来源渠道">
                        <el-input v-model="formInfo.ditchName"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="12" style="width: 35%;">
                <el-form-item label="客户电话">
                    <el-input v-model="formInfo.telephone"></el-input>
                </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-form-item  label="车辆信息">
                </el-form-item>
            </el-row>
            <el-row>
                <el-col :span="12" style="width: 35%">
                    <el-form-item label="车辆品牌">
                        <el-input v-model="formInfo.brands"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="12" style="width: 35%;margin-left: 10%">
                    <el-form-item label="车型">
                        <el-input v-model="formInfo.carModel"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12" style="width: 35%">
                    <el-form-item label="车牌号">
                        <el-input v-model="formInfo.vehicleLicense"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="12" style="width: 35%;margin-left: 10%">
                    <el-form-item label="车架号">
                        <el-input v-model="formInfo.frameNumber"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12" style="width: 35%">
                    <el-form-item label="发动机号">
                        <el-input v-model="formInfo.engineNumber"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="12" style="width: 35%;margin-left: 10%">
                    <el-form-item label="车身颜色">
                        <el-input v-model="formInfo.carColor"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12" style="width: 35%">
                    <el-form-item label="车辆年限">
                        <el-input v-model="formInfo.vehicleYears"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="12" style="width: 35%;margin-left: 10%">
                    <el-form-item label="购车时间">
                        <el-input v-model="formInfo.buyTime" value-format="yyyy-MM-dd"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12" style="width: 35%">
                    <el-form-item label="裸车价格">
                        <el-input v-model="formInfo.bareCarPrice"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="12" style="width: 35%;margin-left: 10%">
                    <el-form-item label="上牌时间">
                        <el-input v-model="formInfo.carLicenseTime" value-format="yyyy-MM-dd"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12" style="width: 35%">
                    <el-form-item label="行驶里程">
                        <el-input v-model="formInfo.drivenDistance"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="12" style="width: 35%;margin-left: 10%">
                    <el-form-item label="车况">
                        <el-input v-model="formInfo.carCondition"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12" style="width: 35%">
                    <el-form-item label="车辆用途">
                        <el-input v-model="formInfo.vehicleUse"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="12" style="width: 35%;margin-left: 10%">
                    <el-form-item label="城市">
                        <el-input v-model="formInfo.city"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
    </el-dialog>



    <el-dialog title="更新客户车辆信息" :visible.sync="dialogFormVisiblemod">
        <el-form :model="form" :inline="true">
            <el-input v-model="form.vehicleInfo_id" value="form.vehicleInfo_id" style="display: none" autocomplete="off"></el-input>
            <el-form-item label="车辆品牌" :label-width="formLabelWidth">
                <el-input v-model="form.brands" style="width: 220px" autocomplete="off"></el-input>
            </el-form-item>

            <el-form-item label="车架号" :label-width="formLabelWidth">
                <el-input v-model="form.vehicleLicense" style="width: 220px" autocomplete="off"></el-input>
            </el-form-item>

            <el-form-item label="车身颜色" :label-width="formLabelWidth">
                <el-input v-model="form.carColor" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="车辆年限" :label-width="formLabelWidth">
                <el-input v-model="form.vehicleYears" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="车况" :label-width="formLabelWidth">
                <el-select v-model="form.carCondition" placeholder="请选择车况">
                    <el-option label="99新" value="99"></el-option>
                    <el-option label="95新" value="95"></el-option>
                    <el-option label="8成新" value="80"></el-option>
                </el-select>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="dialogFormVisiblemod = false">取 消</el-button>
            <el-button type="primary" @click="dialogFormVisiblemod = false,mod(form.vehicleInfo_id)">确 定</el-button>
        </div>
    </el-dialog>
</div>

<div id="paging">

</div>
</body>


<script type="text/javascript" th:inline="javascript">


    <!--页面加载完毕后,把后端查询的数据显示在table中-->
    window.onload=function () {
        demo.findByParam(1,10);
    }


    /**table中的数据*/
        //数据
    let datas = {
            goods: [
                {
                    id:1,
                    brands:'奔驰',
                    vehicleLicense:'358248111',
                    ditchAllname:"支付宝",
                    carColor: '黄色',
                    customerInfoName: "刘德华",
                    customerInfoTelephone:"13123645678",
                    createTime:"",

                        customerInfo:{
                            productInfo:{
                                moneyChannelInfo:{}
                            },
                            orderInfo:{

                            }
                        }




                }
            ]
        };


    var demo = new Vue({
        el: "#app", //绑定的div
        data() {
            return {
                //这是图片上传
                dialogImageUrl: '',
                dialogVisible: false,
                //下面是分页初始参数
                currentPage:1, //初始页
                pagesize:10,    //    每页的数据
                total:60,


                tableData: datas.goods,  //  datas数据 中的数组goods
                dialogFormVisiblemod: false,  //这是点击添加之后，原本隐藏的 编辑框就变为true，就显示编辑框
                dialogFormVisiblefind: false,   //这是点击查看之后，原本隐藏的 编辑框就变为true，就显示编辑框
                dialogFormVisibleadd: false,        //这是新增按钮
                form: {      //这个是添加里面的form表单，一下是表单要修改的内部的字段名
                    vehicleInfo_id: '',
                    brands: '',
                    vehicleLicense: '',
                    carColor: '',
                    vehicleYears: "",
                    carCondition:''

                      //截至这里编辑框内的内容结束
                },

                formInfo: {      //这个是查看里面的formInfo表单，一下是表单要修改的内部的字段名
                    vehicleInfo_id: '',
                    brands: '',
                    vehicleLicense: '',
                    carColor: '',
                    vehicleYears: "",
                    carCondition:''

                    //截至这里编辑框内的内容结束
                },

                AformInfo:{     //新增车辆信息

                    brands:"",          //车辆品牌
                    carModel:"",       //车辆型号
                    vehicleLicense:"",  //车辆牌号
                    frameNumber:"",     //车架号
                    engineNumber:"",    //发动机号
                    carColor:"",        //车身颜色
                    vehicleYears:"",      //车辆年限
                    bareCarPrice:"",    //裸车价格
                    buyTime:"",           //购车时间
                    carLicenseTime:"",    //上牌时间
                    pdrivenDistance:"",  //行驶里程
                    carCondition:"",    //车况
                    vehicleUse:"",      //车辆用途
                    city:"" ,           //城市
                    carApp:"",
                    carAppearance:"",
                    Interior:"",
                    engine:"",
                    chassis:"",
                    other:""

                },
                carApp:"",
                formLabelWidth: '120px',

                //tabledate搜索关键字
                findV:{
                    brands:"",
                    carColor:"",
                    name:"",
                    telephone:""
                },


                //原来属于appo的数据
                restaurants: [],
                state1: '',
                state2: '',

                productInfo:[],
                moneyChannelInfo:[],
                customerInfo:[{
                    id:1,
                    name:'Jinli',
                    telephone:'15508063557',
                    productInfo:[{id:1,
                        moneyChannelInfo:[{
                                id:1,
                                createTime:'2010-2-1'
                        }]
                    }]
                }],

            };
        },






        methods: {

            //这是图片上传
            handleRemove(file, fileList) {
                console.log("这是啥"+file, fileList);
            },

            handleSuccessOne(res){

                demo.AformInfo.carAppearance=res.data;
            },
            handleSuccessTwo(res){
                demo.AformInfo.Interior=res.data;

            },
            handleSuccessThree(res){
                demo.AformInfo.engine=res.data;
                //alert(res.data);
            },
            handleSuccessFour(res){
                demo.AformInfo.chassis=res.data;

            },
            handleSuccessFive(res){
                demo.AformInfo.other=res.data;

            },
            /*handlePictureCardPreview(file) {
                this.dialogImageUrl = file.url;
                alert(file.url),
                this.dialogVisible = true;
            },*/




            // 日期格式化
            dateFormatter (row, column) {
                let datetime = row.customerInfo.productInfo.moneyChannelInfo.createTime;
                if(datetime){
                    datetime = new Date(datetime);
                    let y = datetime.getFullYear() + '-';
                    let mon = datetime.getMonth()+1 + '-';
                    let d = datetime.getDate() +' ';
                    let hourTemp=datetime.getHours();
                    if (hourTemp<10){
                        hourTemp='0'+hourTemp;
                    }
                    let hour = hourTemp+':';
                    let minuteTemp=datetime.getMinutes();
                    if (minuteTemp<10){
                        minuteTemp='0'+minuteTemp;
                    }
                    let minute = minuteTemp+':';
                    let secondTemp=datetime.getSeconds();
                    if (secondTemp<10){
                        secondTemp='0'+secondTemp;
                    }
                    let second = secondTemp;
                    return y + mon + d+ hour+ minute+ second;
                }
                return ''
            },


            //分页
            handleCurrentChange: function(currentPage){
                demo.currentPage = currentPage;
                demo.findByParam(demo.currentPage,10)
            },
            //为鼠标移动上去的js样式
            tableRowClassName({row, rowIndex}) {
                if (rowIndex % 2 === 1) {
                    return 'success-row';

                } else if (rowIndex % 2 === 2) {
                    return 'warning-row';
                }
                return '';
            },


            //分页查询数据：把后端的数据，显示在table上
            findByParam(pageNum,pageSize) {
                console.log("in findByParam");
                let statusRaw = '';
                /* if (this.findUser.status=='-1'){
                    statusRaw='0';
                }else if (this.findUser.status=='1'){
                    statusRaw='1';
                }*/
                //alert("statusRaw="+statusRaw);
                axios.get([[@{vehicle/page}]],
                {
                    params:{
                        pageNum:this.currentPage,
                            pageSize:10,
                            //搜索的关键字
                            brands:this.findV.brands,
                            carColor:this.findV.carColor,
                            name:this.findV.name,
                            telephone:this.findV.telephone
                    }
                })
            .then(resp => {//此处一定要用 箭头函数  不然this 就不是this
                    //console.log("resp=" + resp.data.rows[0].brands);
                    console.log("resp2=" + resp.data.rows);

                    this.tableData = resp.data.rows;
                    this.total = resp.data.total;

                })
                    .catch(error => {
                        console.log(error);
                    });

            },

            //点击表格中某一行的查看后，在弹出的对话框中显示数据
            find_vehicleInfo:(vehicleInfo)=>{
                demo.formInfo.vehicleInfo_id=vehicleInfo.id;
                demo.formInfo.brands=vehicleInfo.brands;
                demo.formInfo.vehicleLicense=vehicleInfo.vehicleLicense;
                demo.formInfo.carColor=vehicleInfo.carColor;
                demo.formInfo.vehicleYears=vehicleInfo.vehicleYears;
                demo.formInfo.carCondition=vehicleInfo.carCondition;

                demo.formInfo.name=vehicleInfo.customerInfo.name;
                demo.formInfo.telephone=vehicleInfo.customerInfo.telephone;
                demo.formInfo.ditchName=vehicleInfo.customerInfo.productInfo.moneyChannelInfo.ditchAllname;
                demo.formInfo.carModel=vehicleInfo.carModel;
                demo.formInfo.frameNumber=vehicleInfo.frameNumber;
                demo.formInfo.engineNumber=vehicleInfo.engineNumber;
                demo.formInfo.bareCarPrice=vehicleInfo.bareCarPrice;
                demo.formInfo.buyTime=vehicleInfo.buyTime;
                demo.formInfo.carLicenseTime=vehicleInfo.carLicenseTime;
                demo.formInfo.drivenDistance=vehicleInfo.drivenDistance;
                demo.formInfo.carCondition=vehicleInfo.carCondition;
                demo.formInfo.vehicleUse=vehicleInfo.vehicleUse;
                demo.formInfo.city=vehicleInfo.city;

                demo.formInfo.num=vehicleInfo.customerInfo.orderInfo.num;
                demo.formInfo.status=vehicleInfo.customerInfo.orderInfo.status;
    },
            //点击表格中某一行的“编辑后”，在 弹出的对话框中填充数据
            fill_vehicleInfo:(vehicleInfo)=>{
                console.log("vehicleInfo.id="+vehicleInfo.id);
                console.log("vehicleInfo.brands="+vehicleInfo.brands);
                console.log("vehicleInfo.vehicleLicense="+vehicleInfo.vehicleLicense);
                console.log("vehicleInfo.carColor="+vehicleInfo.carColor);
                console.log("vehicleInfo.vehicleYears="+vehicleInfo.carCondition);
                //教训：一定是demo.   不要写  this.
                demo.form.vehicleInfo_id=vehicleInfo.id;
                demo.form.brands=vehicleInfo.brands;
                demo.form.vehicleLicense=vehicleInfo.vehicleLicense;
                demo.form.carColor=vehicleInfo.carColor;
                demo.form.vehicleYears=vehicleInfo.vehicleYears;
                demo.form.carCondition=vehicleInfo.carCondition;
            },

            //新增 一个vehicle数据
            add(){
                // alert(this.AformInfo.chassis)
                axios.get([[@{vehicle/more}]],{
                    params:{
                            //搜索的关键字
                     brands:this.AformInfo.brands,
                     vehicleLicense:this.AformInfo.vehicleLicense,
                     carColor:this.AformInfo.carColor,
                     vehicleYears:this.AformInfo.vehicleYears,
                     carCondition:this.AformInfo.carCondition,
                     carModel:this.AformInfo.carModel,
                     frameNumber:this.AformInfo.frameNumber,
                     engineNumber:this.AformInfo.engineNumber,
                     bareCarPrice:this.AformInfo.bareCarPrice,
                     buyTime:this.AformInfo.buyTime,
                     carLicenseTime:this.AformInfo.carLicenseTime,
                     drivenDistance:this.AformInfo.drivenDistance,
                     vehicleUse:this.AformInfo.vehicleUse,
                     city:this.AformInfo.city,


                     carAppearance:this.AformInfo.carAppearance,
                     carInterior:this.AformInfo.Interior,
                     carEngine:this.AformInfo.engine,
                     carChassis:this.AformInfo.chassis,
                     carOther:this.AformInfo.other

                    }
                }).then(res => {
                    console.log(res);
                    location.reload();
                }).catch(function (error) {
                    console.log(error);
                });
            },




                //“编辑”修改 一个vehicle数据
                mod :(id)=>{
                    // alert(id);
                    let params =new FormData();
                    params.append("brands",demo.form.brands);
                    params.append("vehicleLicense",demo.form.vehicleLicense);
                    params.append("job",demo.form.carColor);
                    params.append("vehicleYears",demo.form.vehicleYears);
                    params.append("carCondition",demo.form.carCondition);
                    // alert(id);
                    // alert(demo.form.vehicleYears);
                    axios.put([[@{/vehicle/}]] + id,params).then(res => {
                        console.log(res);
                        location.reload();
                    }).catch(function (error) {
                        console.log(error);
                    });
                },


            exportfile(pageNum,pageSize) {
                //文件导出
                alert("导出当前页");
                //获得当前页面表格的的数据并发送axios
                console.log(JSON.stringify(app.tableData));
                axios.get([[@{poi/gettabledata}]],{
                    params:{
                        pageNum:this.currentPage,
                            pageSize:10,
                            //搜索的关键字
                            brands:this.findV.brands,
                            carColor:this.findV.carColor,
                            name:this.findV.name,
                            telephone:this.findV.telephone
                    }
                }).then(function (msg) {
                        //创建a标签
                        var a = document.createElement("a");
                        var bodyFa = document.getElementsByTagName("body");//
                        bodyFa[0].appendChild(a);//把创建的节点a 添加到父类body 中;
                        // alert(msg.data.msg);
                        a.setAttribute("href", "poi/download?path=" + msg.data.msg);//给创建的a标签设置href值;
                        a.click();
                        bodyFa[0].removeChild(a);
                        alert("导出成功");
                    }
                )
            },



            //查看的点击事件 line=scope.row,当前行的所有参数
            handleClick(line) {
                // alert(line.id);

            },

            //原来属于appo中的方法
            querySearch(queryString, cb) {
                var restaurants = this.restaurants;
                var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
                // 调用 callback 返回建议列表的数据
                cb(results);
            },
            createFilter(queryString) {
                return (restaurant) => {
                    return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
                };
            },
            loadAll() {
                return [
                    {"value": "阳阳麻辣烫", "address": "天山西路389号"},
                    {"value": "南拳妈妈龙虾盖浇饭", "address": "普陀区金沙江路1699号鑫乐惠美食广场A13"}
                ];
            },
            handleSelect(item) {
                console.log(item);
            },


        },//method方法截止



    });


</script>
</html>